<template>
  <FormView
    v-model="entity"
    :title="entity.id ? '阶段信息' : '新建阶段'"
    :toolbar-attrs="{ buttons: ['back', { save: isEnabled, edit: isDisabled }, 'cancel'] }"
    :toolbar-listeners="{ save: persist }">
    <FormHolder ref="form" label-width="130px" :disabled="isDisabled" :model="entity">
      <FormItemGroup block-title="基本信息">
        <FormDatePicker v-model="entity.time" prop="time" label="时间" required/>
        <FormInput v-model="entity.matter" prop="matter" label="事项" required/>
        <FormInput v-model="entity.projectName" block prop="projectName" label="所属项目名称" required />
        <FormTextarea v-model="entity.remark" max-length="1500" prop="remark" label="备注" rows="10"/>
      </FormItemGroup>
    </FormHolder>
  </FormView>
</template>

<script>
  import { save, create, load, update } from './api'
  import form from '@/vue/mixin/form'

  export default {
    name: 'ProjectStageForm',
    docType: '',
    relativeViewId: 'ProjectStageView',
    mixins: [form],
    data() {
      return {
        entity: {
          id: null,
          unid: null,
          createTime: null,
          createBy: null,
          createId: null,
          deptId: null,
          deptFullName: null,
          updateTime: null,
          updateId: null,
          updateBy: null,
          tenantId: null,
          delFlag: null,
          time: null,
          matter: null,
          remark: null,
          projectId: null,
          projectName: null,
        }
      }
    },
    methods: {
      create,
      load,
      save,
      update
    }
  }
</script>